#include "Segment2.h"


const Vector2 Segment2::startPoint() const
{
	return -halfExtents_;
}

const Vector2 Segment2::endPoint() const
{
	return halfExtents_;
}

Segment2::Segment2(const Vector2& halfExtents) : halfExtents_(halfExtents)
{
}

const Vector2 Segment2::internalPoint() const
{
	return Vector2(0, 0);
}

const Vector2 Segment2::supportPoint(const Vector2& normal) const
{
	if (dot(normal, halfExtents_) > 0)
	{
		return endPoint();
	}
	else
	{
		return startPoint();
	}
}

